﻿<?php
Class signupController Extends baseController {
public function index() {
	/*** set a template variable ***/
    $this->registry->template->welcome = 'Đăng Ký Thành Viên';
	/*** load the index template ***/
    $this->registry->template->show('signup');
}
public function add(){
    $username = $_POST["username"];
    $fullname= $_POST["fullname"];
    $pass1= md5($_POST["password"]);
    $pass2= md5($_POST["password2"]);
    $email= $_POST["email"];
    $type = 1;
    $register = date("Y-m-d H:i:s");
    $db = new DB();
    //$db->run("INSERT INTO `users`(`username`, `name`, `email`, `password`, `usertype`, `registerDate`, `lastvisitDate`, `lastResetTime`, `resetCount`) VALUES ('$username','$fullname','$email','$pass1','$type','$register','$register','',0)");
    echo "INSERT INTO `users`(`username`, `name`, `email`, `password`, `usertype`, `registerDate`, `lastvisitDate`, `lastResetTime`, `resetCount`) VALUES ('$username','$fullname','$email','$pass1','$type','$register','$register','',0)";
    $this->registry->template->status = 'Bạn đã đănng ký thành công!';
	/*** load the index template ***/
    $this->registry->template->show('signup_add');
}
}
